<HTML>
  <HEAD>
    <TITLE>threadpool Documentation</TITLE>
    <LINK HREF="threadpool.css" REL="stylesheet" TYPE="text/css">
  </HEAD>
  <BODY BGCOLOR="#FFFFFF">

    <DIV CLASS="qindex">
      <TABLE BORDER="0" WIDTH="100%">
        <TR>

          <TD ALIGN="LEFT">
            <B>threadpool</B>
          </TD>
          <TD ALIGN="RIGHT">
            <A CLASS="qindex" HREF="../index.html">Overview</A> |
            <A CLASS="qindex" HREF="../reference/annotated.html">Reference</A> |
            <A CLASS="qindex" HREF="../tutorial/intro.html">Tutorial</A> |
            <A CLASS="qindex" HREF="../examples/intro.html">Examples</A> |
            <A CLASS="qindex" HREF="../design/intro.html">Design</A>
          </TD>

        </TR>
      </TABLE>
    </DIV>
    <DIV CLASS="qindex">
      <TABLE BORDER="0" WIDTH="100%">
        <TR>
          <TD ALIGN="LEFT">
            <B>Reference</B>
          </TD>
          <TD ALIGN="RIGHT">
            <A CLASS="qindex" HREF="annotated.html">Class List</A> |
            <A CLASS="qindex" HREF="functions.html">Member Functions</A> |
            <A CLASS="qindex" HREF="namespacemembers.html">Typedefs</A> |
            <A CLASS="qindex" HREF="files.html">File List</A>
          </TD>
        </TR>
      </TABLE>
    </DIV>
<!-- Generated by Doxygen 1.4.6-NO -->
<div class="nav">
<a class="el" href="a00035.html">boost</a>::<a class="el" href="a00036.html">threadpool</a>::<a class="el" href="a00016.html">fifo_scheduler</a></div>
<h1>boost::threadpool::fifo_scheduler&lt; Task &gt; Class Template Reference</h1><!-- doxytag: class="boost::threadpool::fifo_scheduler" --><a href="a00003.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;typename Task = task_func&gt;<br>
 class boost::threadpool::fifo_scheduler&lt; Task &gt;</h3>

SchedulingPolicy which implements FIFO ordering. 
<p>
This container implements a FIFO scheduling policy. The first task to be added to the scheduler will be the first to be removed. The processing proceeds sequentially in the same order. FIFO stands for "first in, first out".<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>Task</em>&nbsp;</td><td>A function object which implements the operator()(void). </td></tr>
  </table>
</dl>

<p>

<p>
Definition at line <a class="el" href="a00041.html#l00045">45</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef Task&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a></td></tr>

<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#2173b176c9aea70f1a05015a60beb24c">clear</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#eac21c003c6973c7ab43b754b3a73af7">empty</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#8444283f927fbe045bb4f05b9758c2c8">pop</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#3eb74835370fc37c8b343ecef1260973">push</a> (<a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a> const &amp;task)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#7c9a75e406bace84f39e76fead919c64">size</a> () const </td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a> const &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#b530c63c3bd816cded83df3f8cacf704">top</a> () const </td></tr>

<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::deque&lt; <a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00016.html#e6582c199202df043c8d801e4cb2b50a">m_container</a></td></tr>

</table>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="a364fa4b3952a650ce7436d338935d35"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::task_type" ref="a364fa4b3952a650ce7436d338935d35" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">typedef Task <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::<a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Indicates the scheduler's task type. 
<p>

<p>
Definition at line <a class="el" href="a00041.html#l00048">48</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="2173b176c9aea70f1a05015a60beb24c"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::clear" ref="2173b176c9aea70f1a05015a60beb24c" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">void <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::clear           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Removes all tasks from the scheduler. 
<p>
Definition at line <a class="el" href="a00041.html#l00100">100</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="eac21c003c6973c7ab43b754b3a73af7"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::empty" ref="eac21c003c6973c7ab43b754b3a73af7" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">bool <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::empty           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Checks if the scheduler is empty. <dl compact><dt><b>Returns:</b></dt><dd>true if the scheduler contains no tasks, false otherwise. </dd></dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Is more efficient than <a class="el" href="a00016.html#7c9a75e406bace84f39e76fead919c64">size()</a> == 0. </dd></dl>

<p>
Definition at line <a class="el" href="a00041.html#l00093">93</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="8444283f927fbe045bb4f05b9758c2c8"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::pop" ref="8444283f927fbe045bb4f05b9758c2c8" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">void <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::pop           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Removes the task which should be executed next. 
<p>
Definition at line <a class="el" href="a00041.html#l00067">67</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="3eb74835370fc37c8b343ecef1260973"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::push" ref="3eb74835370fc37c8b343ecef1260973" args="(task_type const &amp;task)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">bool <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::push           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a> const &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>task</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Adds a new task to the scheduler. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>task</em>&nbsp;</td><td>The task object. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true, if the task could be scheduled and false otherwise. </dd></dl>

<p>
Definition at line <a class="el" href="a00041.html#l00059">59</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="7c9a75e406bace84f39e76fead919c64"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::size" ref="7c9a75e406bace84f39e76fead919c64" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">size_t <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::size           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Gets the current number of tasks in the scheduler. <dl compact><dt><b>Returns:</b></dt><dd>The number of tasks. </dd></dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Prefer <a class="el" href="a00016.html#eac21c003c6973c7ab43b754b3a73af7">empty()</a> to <a class="el" href="a00016.html#7c9a75e406bace84f39e76fead919c64">size()</a> == 0 to check if the scheduler is empty. </dd></dl>

<p>
Definition at line <a class="el" href="a00041.html#l00084">84</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="b530c63c3bd816cded83df3f8cacf704"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::top" ref="b530c63c3bd816cded83df3f8cacf704" args="() const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a> const&amp; <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::top           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Gets the task which should be executed next. <dl compact><dt><b>Returns:</b></dt><dd>The task object to be executed. </dd></dl>

<p>
Definition at line <a class="el" href="a00041.html#l00075">75</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="e6582c199202df043c8d801e4cb2b50a"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::m_container" ref="e6582c199202df043c8d801e4cb2b50a" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="mdPrefix" colspan="4">
template&lt;typename Task = task_func&gt; </td>
        </tr>
        <tr>
          <td class="md" nowrap valign="top">std::deque&lt;<a class="el" href="a00016.html#a364fa4b3952a650ce7436d338935d35">task_type</a>&gt; <a class="el" href="a00016.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::<a class="el" href="a00016.html#e6582c199202df043c8d801e4cb2b50a">m_container</a><code> [protected]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Internal task container. 
<p>

<p>
Definition at line <a class="el" href="a00041.html#l00051">51</a> of file <a class="el" href="a00041.html">scheduling_policies.hpp</a>.    </td>
  </tr>
</table>
    <BR>
    <DIV CLASS="qindex">
      <TABLE BORDER="0" WIDTH="100%">
        <TR>
		  <TD CLASS="tiny" ALIGN="LEFT">Copyright &copy 2005-2007 Philipp Henkel</TD>
          <TD ALIGN="RIGHT">
            <A CLASS="qindex" HREF="../index.html">Overview</A> |
            <A CLASS="qindex" HREF="../reference/annotated.html">Reference</A> |
            <A CLASS="qindex" HREF="../tutorial/intro.html">Tutorial</A> |
            <A CLASS="qindex" HREF="../examples/intro.html">Examples</A> |
            <A CLASS="qindex" HREF="../design/intro.html">Design</A>
          </TD>
        </TR>       
      </TABLE>
    </DIV>  
  </BODY>
</HTML>
